package edu.nctu.csie.jichang.dp.creational;

public class Builder {
	public static void main(String[] args) {
		BuilderForm tForm = new BuilderForm();
		new WinBuilder().build(tForm);
		System.out.println(tForm.button + " "+ tForm.windows);
		new UnixBuilder().build(tForm);
		System.out.println(tForm.button + " "+ tForm.windows);
	}
}
class BuilderForm{
	String button;
	String windows;
}
abstract class BuilderFactory{
	abstract void build(BuilderForm form);
}
class WinBuilder extends BuilderFactory{
	void build(BuilderForm form) {
		form.button = "Win Button";
		form.windows = "Win Windows";
	}
}
class UnixBuilder extends BuilderFactory{
	void build(BuilderForm form) {
		form.button = "Unix Button";
		form.windows = "Unix Windows";
	}
}